package com.mxx.qh;

import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;

/**
 * @ClassName: App
 * @Description: java类作用描述
 * @Author: ljf89 (刘江飞)
 * @Date: 2021/1/12-- 11:45
 * @Email: 642371742@qq.com
 */
public class App extends Application {
    @SuppressLint("StaticFieldLeak")
    private static Context context;

    /**
     * 获取全局上下文
     */
    public static Context getContext() {
        return context;
    }

    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        initHa();
    }
    private void initHa() {
//        AliHaConfig config = new AliHaConfig();
//        config.appKey = "333370723"; //配置项：appkey
//        config.appVersion = "7.0"; //配置项：应用的版本号
//        config.appSecret = "9ce38659de8146ba97ca1bd1f4817e99"; //配置项：appsecret
//        config.channel = "qh_debug"; //配置项：应用的渠道号标记，自定义
//        config.userNick = null; //配置项：用户的昵称
//        config.application = this; //配置项：应用指针
//        config.context = getApplicationContext(); //配置项：应用上下文
//        config.isAliyunos = false; //配置项：是否为yunos
////        config.rsaPublicKey = "xxxxxxx"; //配置项：tlog公钥
//        AliHaAdapter.getInstance().addPlugin(Plugin.tlog);
//        AliHaAdapter.getInstance().openDebug(true);
//        AliHaAdapter.getInstance().start(config);
//        TLogService.updateLogLevel(TLogLevel.WARN); //配置项：控制台可拉取的日志级别
    }
}
